#pragma once
/**
=====================================================================================
 CCSVReader
 copyright M.Jurkait 2003

 Description:
  CSV-File parser

  fields are seperated be ';'
  string are in '"'
  commends starts with '/' (not csv style)

 Changes:
=====================================================================================
**/


#define MAX_READED_STRING_LENGTH 1024

class CCSVReader
{
    public:
        CCSVReader(void);
        ~CCSVReader(void);

        bool Open(const char* filename);
        void Close();

        TCHAR* ReadString();
        int  ReadInt();
        float ReadFloat();

        bool NextLine();

    private:

        char readingbuffer[MAX_READED_STRING_LENGTH]; // buffer for readed strings
#ifdef  UNICODE
        TCHAR converter_buffer[MAX_READED_STRING_LENGTH];
#endif
        char* mp_buffer;
        char* mp_runner;

        bool mb_at_lineend; // just for checking, if TRUE next call must be NextLine();
};
